<layout name="page"/>
<block name="content">
	{:widget('page_header/simple',array('name'=>'新建公司'))}
	<form method='post' id="form_data"  class="row frame">
		<input type="hidden" name="opmode" value="add">
		<input type="hidden" name="ajax" id="ajax" value="1">
		<input type="hidden" id="add_file" name="add_file">
		<div class="box col-6">
			<label class="input-label" for="company">公司名称*：</label>
			<input class="input" type="text" id="name" name="name" check="required" info="请输入公司名">
		</div>
		<div class="box col-6">
			<label class="input-label" for="dept">负责人：</label>
			<input class="input" type="text" id="contacts" name="contacts">
		</div>
		<div class="box col-6">
			<label class="input-label" for="dept">公司网站：</label>
			<input class="input" type="text" id="website" name="website">
		</div>
		<div class="box col-6">
			<label class="input-label" for="dept">公司地址：</label>
			<input class="input" type="text" id="address" name="address">
		</div>
		<foreach name="field_list" val="udf_vo">
			{:widget('user_defined_field/edit',array($udf_vo))}
		</foreach>
		<div class="box col-12">
			<label class="input-label" for="remark">其他：</label>
			<textarea class="textarea simple" name="remark" rows="5" class="col-xs-12"></textarea>
		</div>
		<div class="box col-12">
			<label class="input-label" for="name">附件：</label>
			{:widget('file_upload/add')}
		</div>
		<div class="box col-12">
			<label class="input-label" for="name"></label>
			<a class="btn btn-normal" onclick="save()">保存</a>
			<a class="btn btn-return" onclick="go_return_url();">取消</a>
		</div>
	</form>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'udf_field', 'uploader'], function() {
			var $ = layui.jquery;
			var udf_field = layui.udf_field;
			udf_field.init();

			var fn = {
				save : function() {
					send_form("form_data", "{:url('save')}", "{:url('index')}", function(ret) {
						if (ret.status) {
							layer.msg(ret.info, {
								time : 1200
							}, function() {
								location.href = "{:url('index')}";
							});
						} else {
							layer.msg(ret.info);
							return false;
						}
					});
				}
			};

			win_exp(fn);
			//保存后关闭
			$('#btn_save').on('click', function() {

			});
		});

	</script>
</block>